import React, { FC } from 'react'
import './index.less'
import { View } from '@tarojs/components'
import { LOGIN_LOGIN_SUBTITLE, LOGIN_LOGIN_TITLE } from '@/constants'
import PasswordLogin from '@/components/fullScreen/Login/PasswordLogin'
import MiniPhoneLogin from './MiniPhoneLogin'

interface ILogin {
  onRefresh: () => void
  setError: React.Dispatch<
    | React.SetStateAction<{
        code: string
        message: string
        data: any
      }>
    | undefined
  >
}

const Login: FC<ILogin> = (props) => {
  return (
    <View className="pages-login-index">
      <View className={'login-logo'}>
        <View className={'logo-title'}>{LOGIN_LOGIN_TITLE}</View>
        <View className={'logo-subtitle'}>{LOGIN_LOGIN_SUBTITLE}</View>
      </View>

      <View className={'login-content'}>
        <PasswordLogin {...props} />
        <MiniPhoneLogin {...props} />
      </View>
    </View>
  )
}

export default Login
